Skip to content

Refactor MCP for testability; add live and unit tests#21

Open
Loftiii wants to merge 3 commits into
hmk:mainfrom
Loftiii:2025021/task/add_mcp_powers
Open

Refactor MCP for testability; add live and unit tests#21
Loftiii wants to merge 3 commits into
hmk:mainfrom
Loftiii:2025021/task/add_mcp_powers

Conversation

@Loftiii

@Loftiii Loftiii commented Feb 16, 2026

Copy link
Copy Markdown
  • Extract handlers (handleToolCall, handleListResources, handleReadResource, getListToolsResponse) and tool definitions to separate modules
  • Add api.ts with createErrorResult for shared error responses
  • Add Jest config (jest.config.cjs), test and test:live scripts
  • Live tests: 19 tests against Attio API (skip when ATTIO_API_KEY missing), load .env via dotenv
  • Unit tests: tool schema (26 tools) and validation error cases with mock api
  • Index delegates to handlers; create/update/delete record tests use companies

- Extract handlers (handleToolCall, handleListResources, handleReadResource, getListToolsResponse) and tool definitions to separate modules
- Add api.ts with createErrorResult for shared error responses
- Add Jest config (jest.config.cjs), test and test:live scripts
- Live tests: 19 tests against Attio API (skip when ATTIO_API_KEY missing), load .env via dotenv
- Unit tests: tool schema (26 tools) and validation error cases with mock api
- Index delegates to handlers; create/update/delete record tests use companies

Co-authored-by: Cursor <cursoragent@cursor.com>

@Loftiii Loftiii left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant